package cn.windy.samary.core.exception;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 系统自定义异常
 * 当系统发生逻辑错误时，可抛出此异常
 */
@SuppressWarnings("serial")
public class CustomException extends Exception {
    public CustomException(String message) {
        super(message);
        printStackTrace();
        Log log = LogFactory.getLog(this.getClass());
        log.error(message);
    }

    public CustomException(String message, Throwable throwable) {
        super(message, throwable);
        printStackTrace();
        Log log = LogFactory.getLog(this.getClass());
        log.error(message, throwable);
    }
}
